<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/7/1
 * Time: 9:22.
 */

namespace app\admin\controller;

use think\App;
use think\Controller;

class Index extends Common
{
    /**
     * 构造方法.
     *
     * @author   juzi
     * @blog     https://blog.csdn.net/juziaixiao
     *
     * @version  1.0.0
     * @datetime 2020年7月10日09:35:10
     */
    public function __construct()
    {
        // 调用父类前置方法
        parent::__construct();

        // 登录校验
        $this->IsLogin();
    }

    public function page()
    {
        $view = input('get.view');

        return $this->fetch('/page/'.$view);
    }

    public function index()
    {
        return $this->fetch('welcome');
    }
    public function home()
    {
        return $this->fetch();
    }

    public function menus()
    {
        return [
            'code' => 0,
            'msg' => '',
            'count' => 19,
            'data' => [
                [
                    'authorityId' => 1,
                    'authorityName' => '系统管理',
                    'orderNumber' => 1,
                    'menuUrl' => null,
                    'menuIcon' => 'layui-icon-set',
                    'createTime' => '2018/06/29 11:05:41',
                    'authority' => null,
                    'checked' => 0,
                    'updateTime' => '2018/07/13 09:13:42',
                    'isMenu' => 0,
                    'parentId' => -1,
                ],
                [
                    'authorityId' => 2,
                    'authorityName' => '用户管理',
                    'orderNumber' => 2,
                    'menuUrl' => 'system/user',
                    'menuIcon' => null,
                    'createTime' => '2018/06/29 11:05:41',
                    'authority' => null,
                    'checked' => 0,
                    'updateTime' => '2018/07/13 09:13:42',
                    'isMenu' => 0,
                    'parentId' => 1,
                ],
                [
                    'authorityId' => 3,
                    'authorityName' => '查询用户',
                    'orderNumber' => 3,
                    'menuUrl' => '',
                    'menuIcon' => '',
                    'createTime' => '2018/07/21 13:54:16',
                    'authority' => 'user:view',
                    'checked' => 0,
                    'updateTime' => '2018/07/21 13:54:16',
                    'isMenu' => 1,
                    'parentId' => 2,
                ],
                [
                    'authorityId' => 4,
                    'authorityName' => '添加用户',
                    'orderNumber' => 4,
                    'menuUrl' => null,
                    'menuIcon' => null,
                    'createTime' => '2018/06/29 11:05:41',
                    'authority' => 'user:add',
                    'checked' => 0,
                    'updateTime' => '2018/07/13 09:13:42',
                    'isMenu' => 1,
                    'parentId' => 2,
                ],
                [
                    'authorityId' => 5,
                    'authorityName' => '修改用户',
                    'orderNumber' => 5,
                    'menuUrl' => null,
                    'menuIcon' => null,
                    'createTime' => '2018/06/29 11:05:41',
                    'authority' => 'user:edit',
                    'checked' => 0,
                    'updateTime' => '2018/07/13 09:13:42',
                    'isMenu' => 1,
                    'parentId' => 2,
                ],
                [
                    'authorityId' => 6,
                    'authorityName' => '删除用户',
                    'orderNumber' => 6,
                    'menuUrl' => null,
                    'menuIcon' => null,
                    'createTime' => '2018/06/29 11:05:41',
                    'authority' => 'user:delete',
                    'checked' => 0,
                    'updateTime' => '2018/07/13 09:13:42',
                    'isMenu' => 1,
                    'parentId' => 2,
                ],
                [
                    'authorityId' => 7,
                    'authorityName' => '角色管理',
                    'orderNumber' => 7,
                    'menuUrl' => 'system/role',
                    'menuIcon' => null,
                    'createTime' => '2018/06/29 11:05:41',
                    'authority' => null,
                    'checked' => 0,
                    'updateTime' => '2018/07/13 09:13:42',
                    'isMenu' => 0,
                    'parentId' => 1,
                ],
                [
                    'authorityId' => 8,
                    'authorityName' => '查询角色',
                    'orderNumber' => 8,
                    'menuUrl' => '',
                    'menuIcon' => '',
                    'createTime' => '2018/07/21 13:54:59',
                    'authority' => 'role:view',
                    'checked' => 0,
                    'updateTime' => '2018/07/21 13:54:58',
                    'isMenu' => 1,
                    'parentId' => 7,
                ],
                [
                    'authorityId' => 9,
                    'authorityName' => '添加角色',
                    'orderNumber' => 9,
                    'menuUrl' => '',
                    'menuIcon' => '',
                    'createTime' => '2018/06/29 11:05:41',
                    'authority' => 'role:add',
                    'checked' => 0,
                    'updateTime' => '2018/07/13 09:13:42',
                    'isMenu' => 1,
                    'parentId' => 7,
                ],
                [
                    'authorityId' => 10,
                    'authorityName' => '修改角色',
                    'orderNumber' => 10,
                    'menuUrl' => '',
                    'menuIcon' => '',
                    'createTime' => '2018/06/29 11:05:41',
                    'authority' => 'role:edit',
                    'checked' => 0,
                    'updateTime' => '2018/07/13 09:13:42',
                    'isMenu' => 1,
                    'parentId' => 7,
                ],
                [
                    'authorityId' => 11,
                    'authorityName' => '删除角色',
                    'orderNumber' => 11,
                    'menuUrl' => '',
                    'menuIcon' => '',
                    'createTime' => '2018/06/29 11:05:41',
                    'authority' => 'role:delete',
                    'checked' => 0,
                    'updateTime' => '2018/07/13 09:13:42',
                    'isMenu' => 1,
                    'parentId' => 7,
                ],
                [
                    'authorityId' => 12,
                    'authorityName' => '角色权限管理',
                    'orderNumber' => 12,
                    'menuUrl' => '',
                    'menuIcon' => '',
                    'createTime' => '2018/06/29 11:05:41',
                    'authority' => 'role:auth',
                    'checked' => 0,
                    'updateTime' => '2018/07/13 15:27:18',
                    'isMenu' => 1,
                    'parentId' => 7,
                ],
                [
                    'authorityId' => 13,
                    'authorityName' => '权限管理',
                    'orderNumber' => 13,
                    'menuUrl' => 'system/authorities',
                    'menuIcon' => null,
                    'createTime' => '2018/06/29 11:05:41',
                    'authority' => null,
                    'checked' => 0,
                    'updateTime' => '2018/07/13 15:45:13',
                    'isMenu' => 0,
                    'parentId' => 1,
                ],
                [
                    'authorityId' => 14,
                    'authorityName' => '查询权限',
                    'orderNumber' => 14,
                    'menuUrl' => '',
                    'menuIcon' => '',
                    'createTime' => '2018/07/21 13:55:57',
                    'authority' => 'authorities:view',
                    'checked' => 0,
                    'updateTime' => '2018/07/21 13:55:56',
                    'isMenu' => 1,
                    'parentId' => 13,
                ],
                [
                    'authorityId' => 15,
                    'authorityName' => '添加权限',
                    'orderNumber' => 15,
                    'menuUrl' => '',
                    'menuIcon' => '',
                    'createTime' => '2018/06/29 11:05:41',
                    'authority' => 'authorities:add',
                    'checked' => 0,
                    'updateTime' => '2018/06/29 11:05:41',
                    'isMenu' => 1,
                    'parentId' => 13,
                ],
                [
                    'authorityId' => 16,
                    'authorityName' => '修改权限',
                    'orderNumber' => 16,
                    'menuUrl' => '',
                    'menuIcon' => '',
                    'createTime' => '2018/07/13 09:13:42',
                    'authority' => 'authorities:edit',
                    'checked' => 0,
                    'updateTime' => '2018/07/13 09:13:42',
                    'isMenu' => 1,
                    'parentId' => 13,
                ],
                [
                    'authorityId' => 17,
                    'authorityName' => '删除权限',
                    'orderNumber' => 17,
                    'menuUrl' => '',
                    'menuIcon' => '',
                    'createTime' => '2018/06/29 11:05:41',
                    'authority' => 'authorities:delete',
                    'checked' => 0,
                    'updateTime' => '2018/06/29 11:05:41',
                    'isMenu' => 1,
                    'parentId' => 13,
                ],
                [
                    'authorityId' => 18,
                    'authorityName' => '登录日志',
                    'orderNumber' => 18,
                    'menuUrl' => 'system/loginRecord',
                    'menuIcon' => null,
                    'createTime' => '2018/06/29 11:05:41',
                    'authority' => null,
                    'checked' => 0,
                    'updateTime' => '2018/06/29 11:05:41',
                    'isMenu' => 0,
                    'parentId' => 1,
                ],
                [
                    'authorityId' => 19,
                    'authorityName' => '查询登录日志',
                    'orderNumber' => 19,
                    'menuUrl' => '',
                    'menuIcon' => '',
                    'createTime' => '2018/07/21 13:56:43',
                    'authority' => 'loginRecord:view',
                    'checked' => 0,
                    'updateTime' => '2018/07/21 13:56:43',
                    'isMenu' => 1,
                    'parentId' => 18,
                ],
            ],
        ];
    }

    public function getMenuList()
    {
        return [
            'homeInfo' => [
                'title' => '首页',
                'href' => '/admin/Index/home',
            ],
            'logoInfo' => [
                'image' => '/static/layuimini/images/logo.png',
                'title' => '云盟时代',
                'href' => '',
            ],
            'menuInfo' => [
                [
                    'title' => '云盟时代',
                    'icon' => 'fa fa-address-book',
                    'href' => '',
                    'target' => '_self',
                    'child' => [
                        [
                            'title' => '数据中心',
                            'href' => '/admin/DataCenter/index',
                            'icon' => 'fa fa-line-chart',
                            'target' => '_self',
                        ],
                        [
                            'title' => '玩家管理',
                            'href' => '/admin/member/Index',
                            'icon' => 'fa fa-user',
                            'target' => '_self',
                        ],
                        [
                            'title' => '团队管理',
                            'href' => '/admin/team/index',
                            'icon' => 'fa fa-users',
                            'target' => '_self',
                        ],
                        [
                            'title' => '通知管理',
                            'href' => '',
                            'icon' => 'fa fa-bullhorn',
                            'target' => '_self',
                            'child' => [
                                [
                                    'title' => '消息通知',
                                    'href' => '/admin/notice/index?type=1',
                                    'icon' => 'fa fa-volume-off',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '平台通知',
                                    'href' => '/admin/notice/index?type=2',
                                    'icon' => 'fa fa-volume-down',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '弹窗通知',
                                    'href' => '/admin/notice/index?type=3',
                                    'icon' => 'fa fa-volume-up',
                                    'target' => '_self',
                                ],
                            ],
                        ],
                        [
                            'title' => '行业管理',
                            'href' => '',
                            'icon' => 'fa fa-reorder',
                            'target' => '_self',
                            'child' => [
                                [
                                    'title' => '行业管理',
                                    'href' => '/admin/Industry/Index',
                                    'icon' => 'fa fa-glass',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '升级设置',
                                    'href' => '/admin/Industry/Levels',
                                    'icon' => 'fa fa-sort-alpha-asc',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '金币比例',
                                    'href' => '/admin/Ratio/index',
                                    'icon' => 'fa fa-line-chart',
                                    'target' => '_self',
                                ],
                            ],
                        ],

                        [
                            'title' => '活动管理',
                            'href' => '',
                            'icon' => 'fa fa-gift',
                            'target' => '_self',
                            'child' => [
                                [
                                    'title' => '转轮管理',
                                    'href' => '/admin/Active/roulette_index',
                                    'icon' => 'fa fa-life-ring',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '签到管理',
                                    'href' => '/admin/Active/sign_index',
                                    'icon' => 'fa fa-calendar',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '任务管理',
                                    'href' => '/admin/Active/task_index',
                                    'icon' => 'fa fa-tasks',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '每日答题',
                                    'href' => '',
                                    'icon' => 'fa fa-newspaper-o',
                                    'target' => '_self',
                                    'child' => [
                                        [
                                            'title' => '答题奖励',
                                            'href' => '/admin/Active/daliyanswer_write',
                                            'icon' => 'fa fa-file-text-o',
                                            'target' => '_self',
                                        ],
                                        [
                                            'title' => '题目列表',
                                            'href' => '/admin/Active/question_index',
                                            'icon' => 'fa fa-file-text-o',
                                            'target' => '_self',
                                        ],
                                    ],
                                ],
                                [
                                    'title' => '积分兑换管理',
                                    'href' => '/admin/Active/integral_exchange_index',
                                    'icon' => 'fa fa-gbp',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '满送管理',
                                    'href' => '/admin/Active/full_delivery?action=view',
                                    'icon' => 'fa fa-tasks',
                                    'target' => '_self',
                                ],
                            ],
                        ],

                        [
                            'title' => 'IM数据',
                            'href' => '',
                            'icon' => 'fa fa-comments',
                            'target' => '_self',
                            'child' => [
                                [
                                    'title' => '聊天记录查询',
                                    'href' => '/admin/Imdata/chat_records',
                                    'icon' => 'fa fa-comment',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '活跃度统计',
                                    'href' => '/admin/Imdata/chat_activity_static',
                                    'icon' => 'fa fa-bar-chart',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '敏感词汇列表',
                                    'href' => '/admin/Imdata/sensitive_word_index',
                                    'icon' => 'fa fa-file-powerpoint-o',
                                    'target' => '_self',
                                ],
                            ],
                        ],
                        [
                            'title' => '抵用券管理',
                            'href' => '/admin/voucher/index',
                            'icon' => 'fa fa-money',
                            'target' => '_self',
                        ],
                        [
                            'title' => '排行管理',
                            'href' => '/admin/Ranking/Index',
                            'icon' => 'fa fa-sort-amount-asc',
                            'target' => '_self',
                        ],
                        [
                            'title' => '应用管理',
                            'href' => '',
                            'icon' => 'fa fa-gear',
                            'target' => '_self',
                            'child' => [
                                [
                                    'title' => '规则管理',
                                    'href' => '/admin/apply/rules_index/?rules_type=1',
                                    'icon' => 'fa fa-file-excel-o',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '协议管理',
                                    'href' => '/admin/apply/rules_index?rules_type=2',
                                    'icon' => 'fa fa-file-archive-o',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => 'Q/A管理',
                                    'href' => '/admin/apply/qanswer_index',
                                    'icon' => 'fa fa-file-text-o',
                                    'target' => '_self',
                                    'child' => [
                                        [
                                            'title' => 'Q/A管理',
                                            'href' => '/admin/apply/qanswer_index',
                                            'icon' => 'fa fa-file-text-o',
                                            'target' => '_self',
                                        ],
                                       [
                                           'title' => '类型管理',
                                           'href' => '/admin/apply/qtype_index',
                                           'icon' => 'fa fa-file-text-o',
                                           'target' => '_self',
                                       ],
                                    ],
                                ],
                                [
                                    'title' => '教程管理',
                                    'href' => '/admin/apply/rules_index?rules_type=0&type=6',
                                    'icon' => 'fa fa-file-pdf-o',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '版本控制',
                                    'href' => '/admin/apply/version_list',
                                    'icon' => 'fa fa-file-pdf-o',
                                    'target' => '_self',
                                ],
                            ],
                        ],
                        [
                            'title' => '系统设置',
                            'href' => '/admin/systemset/index',
                            'icon' => 'fa fa-gears',
                            'target' => '_self',
                        ],
                        /*
                        [
                            'title' => '主页模板',
                            'href' => '',
                            'icon' => 'fa fa-home',
                            'target' => '_self',
                            'child' => [
                                [
                                    'title' => '主页一',
                                    'href' => '/admin/Index/page?view=welcome-1',
                                    'icon' => 'fa fa-tachometer',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '主页二',
                                    'href' => '/admin/Index/page?view=welcome-2',
                                    'icon' => 'fa fa-tachometer',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '主页三',
                                    'href' => '/admin/Index/page?view=welcome-3',
                                    'icon' => 'fa fa-tachometer',
                                    'target' => '_self',
                                ],
                            ],
                        ],
                        [
                            'title' => '菜单管理',
                            'href' => '/admin/Index/page?view=menu',
                            'icon' => 'fa fa-window-maximize',
                            'target' => '_self',
                        ],
                        [
                            'title' => '系统设置',
                            'href' => '/admin/Index/page?view=setting',
                            'icon' => 'fa fa-gears',
                            'target' => '_self',
                        ],
                        [
                            'title' => '表格示例',
                            'href' => '/admin/Index/page?view=table',
                            'icon' => 'fa fa-file-text',
                            'target' => '_self',
                        ],
                        [
                            'title' => '表单示例',
                            'href' => '',
                            'icon' => 'fa fa-calendar',
                            'target' => '_self',
                            'child' => [
                                [
                                    'title' => '普通表单',
                                    'href' => '/admin/Index/page?view=form',
                                    'icon' => 'fa fa-list-alt',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '分步表单',
                                    'href' => '/admin/Index/page?view=form-step',
                                    'icon' => 'fa fa-navicon',
                                    'target' => '_self',
                                ],
                            ],
                        ],
                        [
                            'title' => '登录模板',
                            'href' => '',
                            'icon' => 'fa fa-flag-o',
                            'target' => '_self',
                            'child' => [
                                [
                                    'title' => '登录-1',
                                    'href' => '/admin/Index/page?view=login-1',
                                    'icon' => 'fa fa-stumbleupon-circle',
                                    'target' => '_blank',
                                ],
                                [
                                    'title' => '登录-2',
                                    'href' => '/admin/Index/page?view=login-2',
                                    'icon' => 'fa fa-viacoin',
                                    'target' => '_blank',
                                ],
                            ],
                        ],
                        [
                            'title' => '异常页面',
                            'href' => '',
                            'icon' => 'fa fa-home',
                            'target' => '_self',
                            'child' => [
                                [
                                    'title' => '404页面',
                                    'href' => '/admin/Index/page?view=404',
                                    'icon' => 'fa fa-hourglass-end',
                                    'target' => '_self',
                                ],
                            ],
                        ],
                        [
                            'title' => '其它界面',
                            'href' => '',
                            'icon' => 'fa fa-snowflake-o',
                            'target' => '',
                            'child' => [
                                [
                                    'title' => '按钮示例',
                                    'href' => '/admin/Index/page?view=button',
                                    'icon' => 'fa fa-snowflake-o',
                                    'target' => '_self',
                                ],
                                [
                                    'title' => '弹出层',
                                    'href' => '/admin/Index/page?view=layer',
                                    'icon' => 'fa fa-shield',
                                    'target' => '_self',
                                ],
                            ],
                        ],
                        */
                    ],
                ],
                /*
                [
                    'title' => '组件管理',
                    'icon' => 'fa fa-lemon-o',
                    'href' => '',
                    'target' => '_self',
                    'child' => [
                        [
                            'title' => '图标列表',
                            'href' => '/admin/Index/page?view=icon',
                            'icon' => 'fa fa-dot-circle-o',
                            'target' => '_self',
                        ],
                        [
                            'title' => '图标选择',
                            'href' => '/admin/Index/page?view=icon-picker',
                            'icon' => 'fa fa-adn',
                            'target' => '_self',
                        ],
                        [
                            'title' => '颜色选择',
                            'href' => '/admin/Index/page?view=color-select',
                            'icon' => 'fa fa-dashboard',
                            'target' => '_self',
                        ],
                        [
                            'title' => '下拉选择',

                            'href' => '/admin/Index/page?view=table-select',

                            'icon' => 'fa fa-angle-double-down',
                            'target' => '_self',
                        ],
                        [
                            'title' => '文件上传',
                            'href' => '/admin/Index/page?view=upload',
                            'icon' => 'fa fa-arrow-up',
                            'target' => '_self',
                        ],
                        [
                            'title' => '富文本编辑器',
                            'href' => '/admin/Index/page?view=editor',
                            'icon' => 'fa fa-edit',
                            'target' => '_self',
                        ],
                        [
                            'title' => '省市县区选择器',
                            'href' => '/admin/Index/page?view=area',
                            'icon' => 'fa fa-rocket',
                            'target' => '_self',
                        ],
                    ],
                ],

                [
                    'title' => '其它管理',
                    'icon' => 'fa fa-slideshare',
                    'href' => '',
                    'target' => '_self',
                    'child' => [
                        [
                            'title' => '多级菜单',
                            'href' => '',
                            'icon' => 'fa fa-meetup',
                            'target' => '',
                            'child' => [
                                [
                                    'title' => '按钮1',
                                    'href' => '/admin/Index/page?view=button',
                                    'icon' => 'fa fa-calendar',
                                    'target' => '_self',
                                    'child' => [
                                        [
                                            'title' => '按钮2',
                                            'href' => '/admin/Index/page?view=button',
                                            'icon' => 'fa fa-snowflake-o',
                                            'target' => '_self',
                                            'child' => [
                                                [
                                                    'title' => '按钮3',
                                                    'href' => '/admin/Index/page?view=button',
                                                    'icon' => 'fa fa-snowflake-o',
                                                    'target' => '_self',
                                                ],
                                                [
                                                    'title' => '表单4',
                                                    'href' => '/admin/Index/page?view=form',
                                                    'icon' => 'fa fa-calendar',
                                                    'target' => '_self',
                                                ],
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                        ],
                        [
                            'title' => '失效菜单',
                            'href' => '/admin/Index/page?view=error',
                            'icon' => 'fa fa-superpowers',
                            'target' => '_self',
                        ],
                    ],
                ],
                */
            ],
        ];
    }
}
